Repository navigation
Conversation
Generated-by: OpenAI Codex Signed-off-by: jiangxt2 <jiangxt2@vip.qq.com>
jiangxt2
marked this pull request as ready for review
November 25, 2026 06:28
jiangxt2
requested review from
AlenkaF,
raulcd,
rok and
wgtmac
as code owners
November 25, 2026 06:28
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Rationale for this change
ORCFile.read(columns=[])andORCFile.read_stripe(..., columns=[])return zero rows for nonempty ORC data. An empty projection should retain the number of rows, asORCFile.iter_batches(columns=[])already does. This follows the discussion in #54926.Closes #55773.
What changes are included in this PR?
Accumulate the number of rows read from ORC batches when the output schema has no fields, and construct a zero-column record batch with that row count. This fixes the C++
Read()andReadStripe()paths and their PythonORCFile.read()andORCFile.read_stripe()interfaces. Add C++ and Python regression tests for whole-file and stripe reads, multiple stripes, empty files, caller-provided schemas and read errors.Are these changes tested?
On macOS arm64 with Release builds, Python 3.13.7 and ORC 2.2.1:
The C++ suite passed 48 tests and skipped one existing time-zone database test limited to ORC versions before 2.0. The Python ORC suite passed 131 tests. C++ and Python format and lint checks passed.
Are there any user-facing changes?
Yes. Empty projections through
ORCFile.read()andORCFile.read_stripe()now return the actual number of rows instead of zero.This PR contains a "Critical Fix". The affected reads report an incorrect row count for nonempty data.
Was AI used for this PR?
PR code and description written by:
Reviewed before submission by:
OpenAI Codex assisted with the implementation, tests, description, and static review. The human contributor directed the scope and approved the implementation and test changes.